/*
============================================================================
 Name        : $(Basename)AppUi.cpp
 Author      : $(Author)
 Version     :
 Copyright   : $(Copyright)
 Description : Main application UI class (controller)
============================================================================
*/

// INCLUDE FILES
#include <avkon.hrh>
#include <aknmessagequerydialog.h>
#include <aknnotewrappers.h>


#include "$(Basename).pan"
#include "$(Basename)Application.h"
#include "$(Basename)AppUi.h"
#include "$(Basename)AppView.h"
#include "$(Basename).hrh"


// ============================ MEMBER FUNCTIONS ===============================


// -----------------------------------------------------------------------------
// C$(Basename)AppUi::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void C$(Basename)AppUi::ConstructL()
	{
	// Initialise app UI with standard value.
	BaseConstructL();

	// Create view object
	iAppView = C$(Basename)AppView::NewL( ClientRect() );
	
	AddToStackL(iAppView);
	}
// -----------------------------------------------------------------------------
// C$(Basename)AppUi::C$(Basename)AppUi()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
C$(Basename)AppUi::C$(Basename)AppUi()
	{
	// No implementation required
	}

// -----------------------------------------------------------------------------
// C$(Basename)AppUi::~C$(Basename)AppUi()
// Destructor.
// -----------------------------------------------------------------------------
//
C$(Basename)AppUi::~C$(Basename)AppUi()
	{
	if ( iAppView )
		{
		RemoveFromStack(iAppView);
		delete iAppView;
		iAppView = NULL;
		}
	}

// -----------------------------------------------------------------------------
// C$(Basename)AppUi::HandleCommandL()
// Takes care of command handling.
// -----------------------------------------------------------------------------
//
void C$(Basename)AppUi::HandleCommandL( TInt aCommand )
	{
	switch( aCommand )
		{
		case EEikCmdExit:
		case EAknSoftkeyExit:
			Exit();
			break;
		default:
			Panic( E$(Basename)Ui );
			break;
		}
	}
// -----------------------------------------------------------------------------
//  Called by the framework when the application status pane
//  size is changed.  Passes the new client rectangle to the
//  AppView
// -----------------------------------------------------------------------------
//
void C$(Basename)AppUi::HandleStatusPaneSizeChange()
	{
	iAppView->SetRect( ClientRect() );
	
	}
		
// End of File